aliens = []
for alien_number in range(30):
    new_alien = {'color':'green','points':5,'speed':'slow'}
    aliens.append(new_alien)

for alien in aliens[:5]:
    print(alien)
print("...")
print(f"Totle number of aliens: {len(aliens)}")

users = {
    'aeinstein':{
        'first':'albert',
        'last':'einstein',
        'location':'princeton',
    },

    'mcurie':{
        'first':'marie',
        'last':'curie',
        'location':'paris',
    },
}

for username,user_info in users.items():
    print(f"\nUsername: {username}")
    full_name = f"{user_info['first']} {user_info['last']}"
    location = user_info['location']
    print(f"\tFull name: {full_name.title()}")
    print(f"\tlocation: {location}")


#练习
#6-7
friends = {
    '周志强':{
        'name':'周志强',
        'age':'20',
        'city':'上饶',
    },
    '丛浩然':{
        'name':'丛浩然',
        'age':'19',
        'city':'济南',
    },
    '王靖圆':{
        'name':'王靖圆',
        'age':'19',
        'city':'十堰',
    }
}
for friend_name,friend_info in friends.items():
    print(f"friend named : {friend_name}")
    print(f"\tage : {friend_info['age']}")
    print(f"\tcity : {friend_info['city']}")

#6-8
pets = {
    'pet_1':{
        'name':'duoduo',
        'breed':'dog',
        'master':'许梦婷'
    },
    'pet_2':{
        'name':'niannian',
        'breed':'cat',
        'master':'陈梦萱'
    },
    'pet_3':{
        'name':'diandian',
        'breed':'dog',
        'master':'胡锦'
    },
}
for pet_no,pet_info in pets.items():
    print(f"宠物编号:{pet_no}")
    print(f"\t宠物名：{pet_info['name']}")
    print(f"\t品种：{pet_info['breed']}")
    print(f"\t主人名：{pet_info['master']}")

